<template>
  <Row>
    <i-col span="8" offset="8" v-for="answer in answers" :key="answer.id">
    <br>
    <div @click="jump(answer.survey_id.survey_no)">
    <div style="float: left;padding: 0 10px 10px 10px">
      <img width="100px" height="100px" :src="answer.survey_id.cover_img">
    </div>
    <div>
      <h1>{{ answer.survey_id.title }}</h1>
    </div>
    <div>
      <p v-html="answer.survey_id.desc"></p>
    </div>
    <div style="float: right; color: red">
      <Icon type="logo-usd" /> {{ answer.survey_id.price }}
    </div>
    <Divider />
    </div>
    </i-col>
  </Row>
</template>

<script>
import util from "@/libs/util";

export default {
  name: 'PcSurvey',
  data() {
    return {
      loading: true,
    	data: {},
      limit: 10,
      answers: {}
    };
  },
	methods: {
		init(page) {
			util.ajax.get('/index/lists', { params: { page: page, limit: this.limit, user_id: 16} })
      .then(response => {
        if (response.code === 200) {
        	this.answers = response.data.lists
        }
      })
		},
    jump (id) {
      this.$router.push({
        name: 'PcAnswer',
        query: { survey_no: id }
      })
    }
	},
  mounted() {
  	this.data = this.$route.query
  	this.init(1)
	}
}
</script>
